local nafeng = fk.CreateSkill{
  name = "hanqing2__nafeng",
}

Fk:loadTranslationTable{
  ["hanqing2__nafeng"] = "纳风",
  [":hanqing2__nafeng"] = "中央区移去牌时，若移去的牌数不大于你上次发动，你可以获得中央区的一张牌。",
}

local DIY = require "packages/diy_utility/diy_utility"

nafeng:addEffect(DIY.BeforeCenterAreaRemove, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(nafeng.name) and
      #player.room:getBanner("@$CenterArea") > 0 and #data.ids <= player:getMark("@hanqing__nafeng")
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:setPlayerMark(player, "@hanqing__nafeng", #data.ids)
    local card = room:askToChooseCard(player, {
      target = player,
      flag = { card_data = {{ "@$CenterArea", room:getBanner("@$CenterArea") }} },
      skill_name = nafeng.name,
      prompt = "#hanqing__nafeng-prey",
    })
    room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, nafeng.name, nil, true, player)
  end,
})

return nafeng
